<?php

namespace App\Models;


use App\Service\Base\Model;

class Student extends Model
{

    // 广告管理
    protected $table = 'student';

    // 缓存字段，用于搜索绑定的字段
    protected $cacheFields = ['id', 'uid',];

    // {"id":"自编号","uid":"用户ID","person_name":"姓名","head_img":"随机的头像","sex":"性别（1-男，2-女，0-保密）","age":"年龄","guardor":"监护人","mobile":"手机号","status":"状态 0-未接入 1-正常接入 -1-删除","is_remind":"是否提醒 1-是","ctime":"注册时间","mtime":"更新时间"}


    // array ( 'id' => '$this->getData("id")', 'uid' => '$this->getData("uid")', 'auth_id' => '$this->getData("auth_id")', 'name' => '$this->getData("name")', 'times' => '$this->getData("times")', 'start_time' => '$this->getData("start_time")', 'end_time' => '$this->getData("end_time")', 'city' => '$this->getData("city")', 'address' => '$this->getData("address")', 'description' => '$this->getData("description")', 'status' => '$this->getData("status")', 'ctime' => '$this->getData("ctime")', 'mtime' => '$this->getData("mtime")', )


    // $id = $this->getData("id"); $uid = $this->getData("uid"); $auth_id = $this->getData("auth_id"); $name = $this->getData("name"); $times = $this->getData("times"); $start_time = $this->getData("start_time"); $end_time = $this->getData("end_time"); $city = $this->getData("city"); $address = $this->getData("address"); $description = $this->getData("description"); $status = $this->getData("status"); $ctime = $this->getData("ctime"); $mtime = $this->getData("mtime");

    // 定义验证操作
    public function rules()
    {

        $add = [
        ];

        $edit = [
        ];

        $info = [
        ];


        $rule = [
            //'uid'         => 'required',
            'person_name' => 'required',
            'head_img'    => 'required',
            'sex'         => 'required',
            'age'         => 'required',
            //'guardor'     => 'required',
            //'is_remind'   => 'required',
            'mobile'      => 'required',
            'status'      => ['in:-1,0,1,2'],
        ];


        $msg = [
            'id'          => '自编号',
            'uid'         => '用户ID',
            'person_name' => '姓名',
            'head_img'    => '随机的头像',
            'sex'         => '性别（1-男，2-女，0-保密）',
            'age'         => '年龄',
            'guardor'     => '监护人',
            'mobile'      => '手机号',
            'status'      => '状态 0-未接入 1-正常接入 -1-删除',
            'is_remind'   => '是否提醒 1-是',
            'ctime'       => '注册时间',
            'mtime'       => '更新时间',
        ];

        return ['rule' => $rule, 'msg' => $msg, 'add' => $add];
    }
}
